import React, { useEffect, useState, useRef } from "react";
import { Link, useModel, history, traverseModifyRoutes, useAccess  } from 'umi';
// import PageTabTwo from "../reportAnalysis/tab2";
import VerifySummary from '~/public/cpas-business/cpas-table/CpasNotes/verifySummary';
const FS_VERIFY_CFG={
  "审定": "/ReportSys/approvedFinance",
  "未审": "/ReportSys/UnFinancialSys/unFinancialStatements",
  "试算": "/ReportSys/trialSys/trialBalance"
};
// const FS_VERIFY_TYPE_CFG = {
//   "未审": {
//     "资产": 1,
//     "负债": 2,
//     "利润": 3,
//     "现流": 4,
//     "现流附": 5
//   },
//   "审定": {
//     "资产": 1,
//     "负债": 2,
//     "利润": 3,
//     "现流": 4,
//     "现流附": 5,
//     "权益变动(本年)": 6,
//     "权益变动(上年)": 7,
//     "减值准备": 8
//   },
//   "试算": {
//     "资产": 1,
//     "负债": 2,
//     "利润": 3,
//     "现流": 4,
//     "现流附": 5,
//     "权益变动(本年)": 6,
//     "权益变动(上年)": 7,
//     "减值准备": 8
//   }
// }
const FsArticulationVerify = () => {
  const { initialState } = useModel('@@initialState');
  const openVerifyDetail = (data: any) => {
    console.log(data, "当前节点数据");
    const {title} = data;
    for(let key in FS_VERIFY_CFG) {
      if(title && title.includes(key)) {
        console.log(`${FS_VERIFY_CFG[key]}?tableName=${title}`,'title----');
        history.push(`${FS_VERIFY_CFG[key]}?tableName=${title}`);
      }
    }
  }
  return (
    <>
      <VerifySummary type="fs" storageName="fsNameData" title="报表勾稽关系汇总" openVerifyDetail={openVerifyDetail} dbname={initialState?.curPart?.dbname}/>
    </>
  )
}

export default FsArticulationVerify
